package com.mercury.pattern._02_factory.simplefactory;

import java.util.Scanner;

public class PizzFactory {
    Pizz createPizz(){
        System.out.println("输入类型：");
        Scanner scanner = new Scanner(System.in);
        String type = scanner.next();
        switch (type){
            case "1": return new GreekPizz("希腊披萨");
            case "2": return new CheesePizz("芝士披萨");
        }
        return null;
    }
}
